package com.hy.service;

import com.hy.mapper.RegionMapper;
import com.hy.medicine.region.City;
import com.hy.medicine.region.District;
import com.hy.medicine.region.Province;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RegionServiceImpl implements RegionService {
    @Autowired
    private RegionMapper regionMapper;

    @Override
    public List<Province> getAllProvinces() {
        return regionMapper.getAllProvinces();
    }

    @Override
    public List<City> getCitiesByProvinceId(Integer provinceId) {
        return regionMapper.getCitiesByProvinceId(provinceId);
    }

    @Override
    public List<District> getDistrictsByCityId(Integer cityId) {
        return regionMapper.getDistrictsByCityId(cityId);
    }

    @Override
    public Province getProvinceById(Integer id) {
        return regionMapper.getProvinceById(id);
    }

    @Override
    public City getCityById(Integer id) {
        return regionMapper.getCityById(id);
    }

    @Override
    public District getDistrictById(Integer id) {
        return regionMapper.getDistrictById(id);
    }
}
